// 房东要把一个房子通过中介租出去
#include <iostream>
#include <string>
// 代理模式
// 出租房子
class RentHouse
{
public:
    virtual void rentHouse() = 0;
};
// 房东
class Landlord : public RentHouse
{
public:
    void rentHouse() override
    {
        std::cout << "将房子租出去\n";
    }
};

// 中介代理出租
class Intermediary : public RentHouse
{
public:
    void rentHouse() override
    {
        std::cout << "发布招租启示\n";
        std::cout << "带人看房\n";
        _landlord.rentHouse();
        std::cout << "负责租后服务\n";
    }

private:
    Landlord _landlord;
};

int main()
{
    Intermediary intermediary; // 中介对象
    intermediary.rentHouse();  // 出租房子
    return 0;
}